home *** CD-ROM | disk | FTP | other *** search
- /*
- File: LProgressIndicatorProxy.h
-
- Contains: Subclass of LProgressIndicator which forwards all
- method calls to a different caller-specified
- LProgressIndicator subclass.
-
- Version: 2.1
-
- Author: Chris K. Thomas, ckt@best.com
-
- Copyright: ©1995 Chris K. Thomas. All Rights Reserved.
- */
-
- #include "LProgressIndicator.h"
-
- class LProgressIndicatorProxy:
- public LProgressIndicator
- {
- LProgressIndicator *mProxyTarget;
-
- public:
-
- LProgressIndicatorProxy()
- {
- mProxyTarget = nil;
- }
-
- LProgressIndicatorProxy(LProgressIndicator *inProxyTarget)
- {
- mProxyTarget = inProxyTarget;
- }
-
- //
- // ValueChanged implementation forwards all
- // value changes to mProxyTarget. Note that if
- // we were called from CompletedThisMuch, all
- // necessary thresholding is already done on
- // the curValue, so calling ValueChanged
- // directly is OK.
- //
-
- virtual void ValueChanged()
- {
- if(mProxyTarget)
- {
- mProxyTarget->mMinValue = mMinValue;
- mProxyTarget->mMaxValue = mMaxValue;
- mProxyTarget->mCurValue = mCurValue;
- mProxyTarget->ValueChanged();
- }
- }
-
- virtual void SetProxyTarget(LProgressIndicator *inProxyTarget)
- {
- mProxyTarget = inProxyTarget;
- }
-
- virtual LProgressIndicator *GetProxyTarget()
- {
- return mProxyTarget;
- }
-
- virtual void SetTaskType(ETaskType inTaskType)
- {
- if(mProxyTarget)
- mProxyTarget->SetTaskType(inTaskType);
- }
- };
-
-